home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2006 June / PCpro_2006_06.ISO / files / freeware / openvip.exe / {app} / App.py < prev    next >
Encoding:
Python Source  |  2003-06-04  |  1.8 KB  |  65 lines

  1. #
  2. # This file is part of OpenVIP (http://openvip.sourceforge.net)
  3. #
  4. # Copyright (C) 2002-2003
  5. # Michal Dvorak, Jiri Sedlar, Antonin Slavik, Vaclav Slavik, Jozef Smizansky
  6. #
  7. # This program is licensed under GNU General Public License version 2;
  8. # see file COPYING in the top level directory for details.
  9. #
  10. # $Id: App.py,v 1.17 2003/06/04 13:41:52 tony_slavik Exp $
  11. #
  12.  
  13. import sys, locale
  14. from wxPython.wx import *
  15. import globals, worker
  16.  
  17. # this will save current thread's ID to logging.__mainThreadID:
  18. import logging
  19.  
  20. import MainFrame
  21.  
  22. mainFrame = None
  23.  
  24. modules ={'FilterSettingsDialog': [0, '', 'FilterSettingsDialog.py'],
  25.  'MainFrame': [1, 'Main frame of Application', 'MainFrame.py'],
  26.  'ObjectPanel': [0, '', 'ObjectPanel.py'],
  27.  'TimelineWidget': [0, '', 'TimelineWidget.py']}
  28.  
  29. class BoaApp(wxApp):
  30.     """Main application. It performs the initialization and
  31.        shows the main window."""
  32.     def OnInit(self):
  33.         locale.setlocale(locale.LC_NUMERIC, "C")
  34.         globals.core.set_ui_callback(logging.UICallback())
  35.        
  36.         self.SetVendorName('OpenVIP')
  37.         self.SetAppName('OpenVIP')
  38.         if sys.platform == 'win32':
  39.             self.cfg = wxConfig('OpenVIP', 'OpenVIP')
  40.         else:
  41.             self.cfg = wxConfig('OpenVIP', 'OpenVIP',
  42.                                 '.openviprc', '/etc/openvip.conf')
  43.         wxConfigBase_Set(self.cfg)
  44.  
  45.         wxInitAllImageHandlers()
  46.         self.main = MainFrame.create(None)
  47.         self.main.Show()
  48.         global mainFrame
  49.         mainFrame = self.main
  50.  
  51.         if len(sys.argv) == 2:
  52.             self.main.OpenFile(sys.argv[1])
  53.         else:
  54.             self.main.OnNewTimeline(None)
  55.         
  56.         return true
  57.  
  58. def main():
  59.     application = BoaApp(0)
  60.     application.MainLoop()
  61.     worker.stop()
  62.  
  63. if __name__ == '__main__':
  64.     main()
  65.